package fiveagon.util;

import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;

public final class Time {
  private static final DateFormat DATE_FORMAT = new SimpleDateFormat("-yyMMdd-HHmmss");

  private Time() {}

  /**
   * Gets a formatted time stamp.
   * 
   * @return a time stamp in the form "-yyMMdd-HHmmss"
   */
  public static String stamp() {
    return DATE_FORMAT.format(new Date());
  }

  public static String stamp(DateFormat dateFormat) {
    return dateFormat.format(new Date());
  }

  public static String stamp(String formatString) {
    return stamp(new SimpleDateFormat(formatString));
  }
}
